'use strict';

/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addIndex('Users', {
      fields: ['username'],
      unique: true,
      name: 'users_username_unique'
    });

    await queryInterface.addIndex('Users', {
      fields: ['role'],
      name: 'users_role_index'
    });
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.removeIndex('Users', 'users_username_unique');
    await queryInterface.removeIndex('Users', 'users_role_index');
  }
};



